home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / apps.to.go / DTS.StyleChat / TRootObj.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-18  |  2.4 KB  |  106 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:        TRootObj.c
  5. ** Written by:    Eric Soldan
  6. **
  7. ** Copyright © 1992 Apple Computer, Inc.
  8. ** All rights reserved.
  9. */
  10.  
  11. /* You may incorporate this sample code into your applications without
  12. ** restriction, though the sample code has been provided "AS IS" and the
  13. ** responsibility for its operation is 100% yours.  However, what you are
  14. ** not permitted to do is to redistribute the source as "DSC Sample Code"
  15. ** after having made changes. If you're going to re-distribute the source,
  16. ** we require that you make it clear in the source that the code was
  17. ** descended from Apple Sample Code, but that you've made changes. */
  18.  
  19. /* See the files "=How to write your app" and "=Using TreeObj.c" for information
  20. ** on this function. */
  21.  
  22. /* This file isn't really used for much here.  The whole hierarchical document usage of
  23. ** AppWannabe is very limited.  This file is here so that AppWannabe can be converted
  24. ** into an application that does use the hierarchical document architecture.  AppWannabe
  25. ** is all set up to start using it.  This is convenient, as it allows there to be an
  26. ** initial document type. */
  27.  
  28.  
  29.  
  30. /*****************************************************************************/
  31.  
  32.  
  33.  
  34. #include "App.h"            /* Get the application includes/typedefs, etc.    */
  35. #include "App.protos.h"        /* Get the prototypes for application.            */
  36.  
  37. #ifndef __OSEVENTS__
  38. #include <OSEvents.h>
  39. #endif
  40.  
  41. #ifndef __OSUTILS__
  42. #include <OSUtils.h>
  43. #endif
  44.  
  45. #ifndef __QUICKDRAW__
  46. #include <Quickdraw.h>
  47. #endif
  48.  
  49. #ifndef __STRING__
  50. #include <String.h>
  51. #endif
  52.  
  53. #ifndef __UTILITIES__
  54. #include "Utilities.h"
  55. #endif
  56.  
  57.  
  58.  
  59. #pragma segment DrawObjects
  60. long    TRootObj(TreeObjHndl hndl, short message, long data)
  61. {
  62.     short    fileRefNum;
  63. #if VH_VERSION
  64.     char    *cptr;
  65. #endif
  66.  
  67.     switch (message) {
  68.         case FREADMESSAGE:
  69.             fileRefNum = data;
  70.             return(ReadTreeObjData(hndl, fileRefNum));
  71.             break;
  72.  
  73.         case FWRITEMESSAGE:
  74.             fileRefNum = data;
  75.             return(WriteTreeObjData(hndl, fileRefNum));
  76.             break;
  77.  
  78.         case HREADMESSAGE:
  79.             return(HReadTreeObjData(hndl, (Handle)data));
  80.             break;
  81.  
  82.         case HWRITEMESSAGE:
  83.             return(HWriteTreeObjData(hndl, (Handle)data));
  84.             break;
  85.  
  86.         case VHMESSAGE:
  87. #if VH_VERSION
  88.             cptr = ((VHFormatDataPtr)data)->data;
  89.             ccatchr(cptr, 13, 2);
  90.             VHRootInfo(hndl, cptr);
  91.             ccatchr(cptr, 13, 2);
  92.             VHFileRecInfo(hndl, cptr);
  93.             return(true);
  94. #endif
  95.             break;
  96.  
  97.         default:
  98.             break;
  99.     }
  100.  
  101.     return(noErr);
  102. }
  103.  
  104.  
  105.  
  106.